package com.example.demo.Controller;


import com.example.demo.Bean.RegionStats;
import com.example.demo.Response.CommonResp;
import com.example.demo.Service.DataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/test")
public class DataController {
    @Autowired
    private DataService dataService;


    @GetMapping("/list")
    public CommonResp list(){
        CommonResp<List<RegionStats>> resp = new CommonResp<>();
        List<RegionStats> list = dataService.list();
        resp.setContent(list);
        return resp;

    }

}
